import numpy as np
import os

def log_daily(values,  f_or_title='daily curve', hr_per_pt=0.5, root_out=None):
    ulim = int(24 / hr_per_pt)
    data = values[:ulim]
    tlist = np.linspace(hr_per_pt, 24+hr_per_pt, ulim)
    fp_out = os.path.join(root_out, f_or_title+'.txt')
    with open(fp_out, 'w') as h:
        h.write('time(unit=%.1fhr)\tdata\n' % hr_per_pt)
        [h.write('%d\t%.4f\n' % (t, d)) for t, d in zip(tlist, data)]
            